<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	template="/WEB-INF/layout/t.xhtml">

	<ui:define name="title">
		<h:outputText value="Scheda Pagina" />
	</ui:define>
	<ui:define name="roles">
		<f:attribute name="roles" value="page" />
	</ui:define>

	<ui:define name="content">
		<style>
.col1 {
	width: 35%;
	text-align: left;
}

.col2 {
	width: 65%;
	text-align: left;
}
</style>
		<h:form>
			<center>
				<p:panel header="Scheda Pagina">
					<h:panelGrid columns="2" style="width: 95%"
						columnClasses="col1,col2">

						<h:outputLabel value="Titolo:" for="titolo" />
						<h:outputText id="titolo" value="#{pageController.element.title}"
							style="width: 100%;" />
						<h:outputLabel value="Descrizione:" for="descrizione" />
						<h:outputText id="descrizione"
							value="#{pageController.element.description}" style="width: 100%;" />

						<h:outputLabel value="Modello:" for="template" />
						<h:outputText id="template"
							value="#{pageController.element.template.template.name}" />

						<h:outputText value="&lt;hr/&gt;" escape="false" />
						<h:outputText />

						<h:outputLabel value="Intestazione:" for="header"
							rendered="#{not empty pageController.element.template.header}" />
						<h:inputTextarea disabled="true" id="header"
							value="#{pageController.element.template.header}"
							style="color: black; width: 100%;" escape="false"
							rendered="#{not empty pageController.element.template.header}" />

						<h:outputText value="&lt;hr/&gt;" escape="false"
							rendered="#{not empty pageController.element.template.header}" />
						<h:outputText
							rendered="#{not empty pageController.element.template.header}" />

						<h:outputLabel value="Colonna 1:" for="col1"
							rendered="#{not empty pageController.element.template.col1}" />
						<h:inputTextarea disabled="true" id="col1"
							value="#{pageController.element.template.col1}"
							style="color: black; width: 100%;" escape="false"
							rendered="#{not empty pageController.element.template.col1}" />

						<h:outputLabel value="Colonna 2:" for="col2"
							rendered="#{not empty pageController.element.template.col2}" />
						<h:inputTextarea disabled="true" id="col2"
							value="#{pageController.element.template.col2}"
							style="color: black; width: 100%;" escape="false"
							rendered="#{not empty pageController.element.template.col2}" />

						<h:outputLabel value="Colonna 3:" for="col3"
							rendered="#{not empty pageController.element.template.col3}" />
						<h:inputTextarea disabled="true" id="col3"
							value="#{pageController.element.template.col3}"
							style="color: black; width: 100%;" escape="false"
							rendered="#{not empty pageController.element.template.col3}" />

						<h:outputText value="&lt;hr/&gt;" escape="false"
							rendered="#{not empty pageController.element.template.col3 or not empty pageController.element.template.col2 or not empty pageController.element.template.col1}" />
						<h:outputText
							rendered="#{not empty pageController.element.template.col3 or not empty pageController.element.template.col2 or not empty pageController.element.template.col1}" />

						<h:outputLabel value="Pie' di pagina:" for="footer"
							rendered="#{not empty pageController.element.template.footer}" />
						<h:inputTextarea disabled="true" id="footer"
							value="#{pageController.element.template.footer}"
							style="color: black; width: 100%;" escape="false"
							rendered="#{not empty pageController.element.template.footer}" />

					</h:panelGrid>
					<br />

				</p:panel>
				<br /> <br />

				<h:panelGrid columns="1">
					<h:outputLink target="_blank"
						value="#{request.contextPath}/page/#{pageController.element.id}">
						<h:outputText value="anteprima" />
					</h:outputLink>
				</h:panelGrid>
				<br />

				<h:panelGrid columns="2">

					<h:commandButton action="#{pageController.modCurrent}"
						value="Modifica" immediate="false" />

					<h:commandButton id="reset" action="#{pageController.reset}"
						value="Indietro" immediate="true" rendered="false" />

				</h:panelGrid>
			</center>

		</h:form>
	</ui:define>
</ui:composition>